A modern, feature-rich utility for running SuiteQL queries directly in NetSuite with a professional SQL IDE experience.
The SuiteQL Query Tool is a powerful NetSuite Suitelet application designed for developers, administrators, and analysts who need to query NetSuite data using SuiteQL. It provides a modern, intuitive interface inspired by professional SQL IDEs like SQL Server Management Studio and Azure Data Studio.
Developed by Tim Dietrich, this open-source tool transforms the way you interact with NetSuite's SuiteQL capabilities, offering features like syntax highlighting, auto-complete, query history, and multiple export formats.
Follow these steps to install the SuiteQL Query Tool in your NetSuite account:
Navigate to Documents > Files > File Cabinet in NetSuite. Create a folder for your scripts (e.g., SuiteScripts/SuiteQL) and upload the suiteql-query-tool.v2026.01.suitelet.js file.
Go to Customization > Scripting > Scripts > New. Select the uploaded file and click Create Script Record. Fill in the details:
After saving the script record, click Deploy Script. Configure the deployment:
After deployment, you can access the tool via the external URL provided in the deployment record, or by navigating to Customization > Scripting > Script Deployments and clicking the deployment link.
Describe what you need in plain English and get working SuiteQL queries instantly. Supports Anthropic and OpenAI.
Quick input bar above the editor - type plain English and generate queries directly.
Click "Explain" to have AI break down complex queries into plain English.
AI reviews your query before execution, warning about potential issues.
Ask AI about any table, find the right tables, and generate queries from selected columns.
For slow queries, AI suggests indexes, better joins, and restructuring.
CodeMirror-powered editor with full SQL syntax highlighting and line numbers.
Table and column name suggestions with Ctrl+Space for faster query writing.
Automatically saves your query history locally for easy access to previous queries.
Toggle between light and dark themes for comfortable viewing in any environment.
Export results to Excel (.xlsx), CSV, JSON, or copy directly to clipboard.
View SUM, AVG, MIN, and MAX for numeric columns in your results.
Use {{variable}} syntax for dynamic queries with prompted input.
Generate shareable URLs that include your query for easy collaboration.
Freeze the first 1-3 columns while scrolling horizontally through results.
Import SQL files by dragging and dropping them onto the editor.
Drag column headers to reorder columns in the results table.
Hide the editor to view results in full-screen mode.
When you first open the SuiteQL Query Tool, you'll see a sample query in the editor. You can modify this or write your own query. Here's a simple example to get started:
SELECT
id,
companyname,
email,
datecreated
FROM
customer
WHERE
isinactive = 'F'
ORDER BY
datecreated DESC
Click the Run Query button or press Ctrl + Enter to execute the query.
The editor supports standard SuiteQL syntax with SQL highlighting. SuiteQL is NetSuite's SQL-like query language that allows you to query NetSuite records.
Press Ctrl + Space to trigger auto-complete suggestions. The tool provides suggestions for:
Use double curly braces to create dynamic parameters in your queries:
SELECT * FROM customer
WHERE datecreated >= '{{Start Date}}'
AND datecreated <= '{{End Date}}'
When you run the query, you'll be prompted to enter values for each parameter. The tool remembers your last-used values.
You can import SQL files in two ways:
Click the history icon in the toolbar to view and restore previous editor states. This is useful if you accidentally delete or modify your query.
The results panel offers three view modes:
Click any row in the results to open a detailed view showing all fields for that record. Use the arrow keys to navigate between rows while the detail view is open.
Click the Export button to export your results:
Press Shift + R or click the expand button to hide the editor and maximize the results panel. Press Esc or click the button again to restore.
Press ? at any time to view the keyboard shortcuts modal.
| Action | Shortcut |
|---|---|
| Run Query | Ctrl + Enter |
| Format Query | Ctrl + Shift + F |
| Save Query | Ctrl + S |
| Undo | Ctrl + Z |
| Redo | Ctrl + Shift + Z |
| Auto-Complete | Ctrl + Space |
| Maximize Results | Shift + R |
| Exit Focus/Maximized Mode | Esc |
| Previous Row (in details) | ← |
| Next Row (in details) | → |
| Show Shortcuts | ? |
Access the built-in Query Library from the toolbar to browse pre-built queries for common NetSuite tasks. These queries serve as useful examples and starting points for your own queries.
Click Tables Reference in the toolbar to open a new window with a searchable list of all NetSuite tables available for querying.
Click the Focus Mode button (expand arrows icon) in the header to hide the NetSuite navigation and maximize your workspace. Combined with Results Maximized mode, you can dedicate your entire screen to query results.
Click Share in the toolbar to generate a URL that includes your current query. Anyone with access to the Suitelet can use this URL to open the tool with your query pre-loaded.
Your current query is automatically saved to local storage as you type. If you accidentally close the browser or navigate away, your query will be restored when you return.
The tool tracks execution times for your queries, displayed in the results header. This helps you optimize query performance.
The AI Query Generator allows you to describe your data needs in plain English and receive working SuiteQL queries. It supports both Anthropic (Claude) and OpenAI (GPT) models.
Click the AI button in the toolbar, then click the gear icon to open settings. Select your provider (Anthropic or OpenAI), enter your API key, and choose a model.
Type a natural language description of the data you need. For example: "Show me all active customers with their sales rep" or "Find invoices from last month over $1000".
Click Insert Query to add the generated SQL to the editor. Enable Auto-execute query to run it immediately.
Beyond the conversational AI Query Generator, the tool offers several AI-powered features integrated directly into the editor toolbar.
Click the Ask button in the toolbar to toggle the natural language query bar. This provides a quick way to generate queries without opening the full AI modal:
Your visibility preference is saved, so the bar will remember whether you prefer it shown or hidden.
Click the Explain button (lightbulb icon) to have AI analyze your current query and explain it in plain English. This is useful for:
The explanation covers: what data is retrieved, tables used, joins and their purpose, filter conditions, and sorting/grouping.
Click the Validate button (shield icon) before running your query to have AI check for potential issues:
The validation panel shows issues found and suggestions for improvement, with options to "Run Anyway" or close.
When a query takes longer than 5 seconds to execute, a banner appears offering AI optimization suggestions:
Click Tables in the toolbar to open the Tables Reference in a new window. This powerful tool helps you explore NetSuite's database schema with AI assistance.
Toggle to AI Find mode to search for tables using natural language:
When viewing any table's details, you'll see an "Ask AI About This Table" section with preset questions:
Build queries by selecting columns from the table detail view:
Use the checkboxes next to each column to select the fields you want. Use "Select All" or "Clear" for quick selection.
Click the Generate Query button. AI will create a practical query with your selected columns, including appropriate WHERE conditions and JOIN suggestions.
Click the Options button in the toolbar to access configuration settings:
Advanced users can modify the CONFIG object at the top of the script file:
const CONFIG = Object.freeze({
VERSION: '2026.01',
DATATABLES_ENABLED: true,
REMOTE_LIBRARY_ENABLED: true,
ROWS_RETURNED_DEFAULT: 100,
QUERY_FOLDER_ID: null, // Set to enable local library
WORKBOOKS_ENABLED: false,
MAX_HISTORY_ENTRIES: 50
});
This usually indicates a syntax error in your SuiteQL query. Check for:
For additional help: